package com.bill.common.user.action;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;
import org.compass.core.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import com.bill.common.business.dto.SellDTO;
import com.bill.common.system.dto.ExtractDTO;
import com.bill.common.system.dto.GenealogicalTreeDTO;
import com.bill.common.user.dto.AccountDTO;
import com.bill.common.user.dto.RegUserBasicDTO;
import com.bill.common.user.dto.RegisterUserDTO;
import com.bill.common.user.dto.RegisterUserGridDTO;
import com.bill.common.user.dto.RegisterUserQueryDTO;
import com.bill.common.user.dto.XPTreeViewDTO;
import com.bill.common.user.service.IRegisterUserService;
import com.opensymphony.xwork2.ActionSupport;
import com.sinba.common.dto.PageDTO;
import com.sun.net.httpserver.Authenticator.Success;

@SuppressWarnings("serial")
public class RegisterUserAction extends ActionSupport {
	@Autowired
	private IRegisterUserService registerUserService;
	private PageDTO pageDTO = new PageDTO();
	private String pwdLevel;
	private RegisterUserDTO registerUserDTO = new RegisterUserDTO();
	private RegisterUserQueryDTO registerUserQueryDTO = new RegisterUserQueryDTO();
	private Long[] ids;
    private String sord;
    private String sidx;
    private int page = 1;
    private int rows = 10;
    private boolean result = false;
    private String resultStr;
    private RegUserBasicDTO rubDTO = new RegUserBasicDTO();
    private AccountDTO acDTO = new AccountDTO();
    private String pageUrl;
    private Date startTime;
    private String dtype;
    private String loginName;
    private Double moeny;
    private Map<String, List<String>> teamYeJiStat;
    private XPTreeViewDTO treeViewDTO;
    private List<XPTreeViewDTO> children = new ArrayList<XPTreeViewDTO>();
    private String findResult;
    private String lang;
    private GenealogicalTreeDTO genealogicalTreeDTO;
    private String loginReg;
    private String activeType;
    private String registerLocation;
    private List<RegisterUserGridDTO> registerUserGridDTOs = new ArrayList<RegisterUserGridDTO>();
	private String userStatus;
	private String optType;
	private String transAccount;
	private Double value;
	private ExtractDTO extractDTO;
	private String type;
	private String upLevel;
	private SellDTO sellDTO;
	public String getUpLevel() {
		return upLevel;
	}
	public void setUpLevel(String upLevel) {
		this.upLevel = upLevel;
	}
	public String getFindResult() {
		return findResult;
	}
	public void setFindResult(String findResult) {
		this.findResult = findResult;
	}
	public String getResultStr() {
		return resultStr;
	}
	public void setResultStr(String resultStr) {
		this.resultStr = resultStr;
	}
	public PageDTO getPageDTO() {
		return pageDTO;
	}
	public void setPageDTO(PageDTO pageDTO) {
		this.pageDTO = pageDTO;
	}
	public String getPwdLevel() {
		return pwdLevel;
	}
	public void setPwdLevel(String pwdLevel) {
		this.pwdLevel = pwdLevel;
	}

	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getTransAccount() {
		return transAccount;
	}
	public void setTransAccount(String transAccount) {
		this.transAccount = transAccount;
	}
	public Double getValue() {
		return value;
	}
	public void setValue(Double value) {
		this.value = value;
	}

	public ExtractDTO getExtractDTO() {
		return extractDTO;
	}
	public void setExtractDTO(ExtractDTO extractDTO) {
		this.extractDTO = extractDTO;
	}
	public Long[] getIds() {
		return ids;
	}
	public void setIds(Long[] ids) {
		this.ids = ids;
	}
	public String getSord() {
		return sord;
	}
	public void setSord(String sord) {
		this.sord = sord;
	}
	public String getSidx() {
		return sidx;
	}
	public void setSidx(String sidx) {
		this.sidx = sidx;
	}
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}
	public int getRows() {
		return rows;
	}
	public void setRows(int rows) {
		this.rows = rows;
	}
	public boolean isResult() {
		return result;
	}
	public void setResult(boolean result) {
		this.result = result;
	}
	public RegisterUserDTO getRegisterUserDTO() {
		return registerUserDTO;
	}
	public void setRegisterUserDTO(RegisterUserDTO registerUserDTO) {
		this.registerUserDTO = registerUserDTO;
	}
	public RegisterUserQueryDTO getRegisterUserQueryDTO() {
		return registerUserQueryDTO;
	}
	public void setRegisterUserQueryDTO(RegisterUserQueryDTO registerUserQueryDTO) {
		this.registerUserQueryDTO = registerUserQueryDTO;
	}
	public RegUserBasicDTO getRubDTO() {
		return rubDTO;
	}
	public void setRubDTO(RegUserBasicDTO rubDTO) {
		this.rubDTO = rubDTO;
	}
	public String getPageUrl() {
		return pageUrl;
	}
	public void setPageUrl(String pageUrl) {
		this.pageUrl = pageUrl;
	}
	public AccountDTO getAcDTO() {
		return acDTO;
	}
	public void setAcDTO(AccountDTO acDTO) {
		this.acDTO = acDTO;
	}
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public String getDtype() {
		return dtype;
	}
	public void setDtype(String dtype) {
		this.dtype = dtype;
	}
	public String getLoginName() {
		return loginName;
	}
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	public Double getMoeny() {
		return moeny;
	}
	public void setMoeny(Double moeny) {
		this.moeny = moeny;
	}
	public Map<String, List<String>> getTeamYeJiStat() {
		return teamYeJiStat;
	}
	public void setTeamYeJiStat(Map<String, List<String>> teamYeJiStat) {
		this.teamYeJiStat = teamYeJiStat;
	}
	
	public XPTreeViewDTO getTreeViewDTO() {
		return treeViewDTO;
	}
	public void setTreeViewDTO(XPTreeViewDTO treeViewDTO) {
		this.treeViewDTO = treeViewDTO;
	}
	
	public String getLang() {
		return lang;
	}
	public void setLang(String lang) {
		this.lang = lang;
	}
	public List<XPTreeViewDTO> getChildren() {
		return children;
	}
	public void setChildren(List<XPTreeViewDTO> children) {
		this.children = children;
	}
	
	public GenealogicalTreeDTO getGenealogicalTreeDTO() {
		return genealogicalTreeDTO;
	}
	public void setGenealogicalTreeDTO(GenealogicalTreeDTO genealogicalTreeDTO) {
		this.genealogicalTreeDTO = genealogicalTreeDTO;
	}
	
	public String getLoginReg() {
		return loginReg;
	}
	public void setLoginReg(String loginReg) {
		this.loginReg = loginReg;
	}
	
	public String getActiveType() {
		return activeType;
	}
	public void setActiveType(String activeType) {
		this.activeType = activeType;
	}
	public String getRegisterLocation() {
		return registerLocation;
	}
	public void setRegisterLocation(String registerLocation) {
		this.registerLocation = registerLocation;
	}
	
	public List<RegisterUserGridDTO> getRegisterUserGridDTOs() {
		return registerUserGridDTOs;
	}
	public void setRegisterUserGridDTOs(
			List<RegisterUserGridDTO> registerUserGridDTOs) {
		this.registerUserGridDTOs = registerUserGridDTOs;
	}
	
	public String getUserStatus() {
		return userStatus;
	}
	public void setUserStatus(String userStatus) {
		this.userStatus = userStatus;
	}
	
	
	public String getOptType() {
		return optType;
	}
	public void setOptType(String optType) {
		this.optType = optType;
	}
	public SellDTO getSellDTO() {
		return sellDTO;
	}
	public void setSellDTO(SellDTO sellDTO) {
		this.sellDTO = sellDTO;
	}
	public String findRegisterUserPager(){
        int start = ( page - 1 ) * rows;
        registerUserQueryDTO.setStart( start );
        registerUserQueryDTO.setLimit( rows );
        pageDTO = registerUserService.findRegisterUserPager(registerUserQueryDTO, sord, sidx);
        if(pageDTO!=null){
        	pageDTO.setPage( page );
        	pageDTO.setRows( rows );
        }
        return SUCCESS;
    }
	
	public String userLogin(){
		registerUserDTO = registerUserService.userLogin(registerUserDTO, pwdLevel);
		return "registerUserDTO";
	}
	
	
	public String saveRegiserUser(){
		try {
			resultStr = registerUserService.saveRegisterUser(registerUserDTO);
			loginName = registerUserDTO.getLoginName();
		} catch (Exception e) {
			e.printStackTrace();
			resultStr = "Registration failed, please re register, thank you! \n 注册失败，请重新注册，谢谢!";
		}
		if("reg1".equals(loginReg)){
			return "registerResultNew";
		}else{
			return "registerResultNew";
		}
		
	}
	
	public String saveRegisterUserAuth(){
		resultStr = registerUserService.saveRegisterUserAuth(registerUserDTO);
		return "resultStr";
	}
	
	public String editRegisterUser(){
		registerUserService.editRegisterUser(registerUserDTO);
		return SUCCESS;
	}
    
	public String updateRegisterUser(){
		registerUserService.updateRegisterUser(registerUserDTO);
		return SUCCESS;
	}
	
	public String deleteRegisterUser(){
		resultStr = registerUserService.deleteRegisterUser(ids);
		return "resultStr";
	}
	
	public String deleteRegisterUserByLoginName(){
		
		if(pageUrl==null || pageUrl=="")
			pageUrl="index.jsp";
		HttpSession session = ServletActionContext.getRequest().getSession();
		if(session.getAttribute("loginName")!=null){
			resultStr = registerUserService.deleteRegisterUser(registerUserDTO.getLoginName());
		}else{
			resultStr = "系统超时，请重新登录!";
		}
		return "optresult";
	}
	
	public String findRegisterUserByIdOrLoginName(){
		registerUserDTO = registerUserService.findRegisterUserByIdOrLoginName(registerUserQueryDTO);
		return "registerUserDTO";
	}
	
	public String loginNameExist(){
		result = registerUserService.loginNameExist(registerUserQueryDTO);
		return "result";
	}
	
	public String updatePassword(){
		registerUserService.updatePassword(registerUserDTO, pwdLevel);
		return SUCCESS;
	}
	
	public String userValidate(){
		result = registerUserService.userValidate(registerUserDTO.getLoginName(), registerUserDTO.getPassword1(), pwdLevel);
		if(result)
			return "loginSuccess";
		else
			return "loginFailure";
	}
	
	public String checkOrdPassword(){
		result = registerUserService.checkOrdPassword(registerUserDTO.getLoginName(),registerUserDTO.getPassword1(), pwdLevel);
		return "result";
	}
	public String findRegUserBasicInfo(){
		
		rubDTO = registerUserService.findRegUserBasicInfo(registerUserDTO.getLoginName());
		return "pipage";
	}
	public String changeRegUserBasicInfo(){
		
		if(pageUrl==null || pageUrl=="")
			pageUrl="index.jsp";
		resultStr = registerUserService.changeRegUserBasicInfo(rubDTO);
		return "optresult";
	}
	
	public String changeMobile(){
		
		if(pageUrl==null || pageUrl=="")
			pageUrl="index.jsp";
		resultStr = registerUserService.changeMobile(rubDTO);
		return "optresult";
	}
	
	public String findAccountByLoginName(){
		if(pageUrl==null || pageUrl=="")
			pageUrl="index.jsp";
		acDTO = registerUserService.findAccountByLoginName(registerUserDTO.getLoginName());
		return "dynamicReturn";
	}
	
	public String getBack(){
		resultStr = registerUserService.findPasswordByMobile(registerUserDTO);
		//resultStr= registerUserService.checkGetBackInfo(rubDTO,registerUserDTO,pwdLevel);
		return "fpreturn";
	}
	
	
	public String password3Valid(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		if(session.getAttribute("loginName")!=null){
			result=registerUserService.password3Valid((String)session.getAttribute("loginName"), registerUserDTO.getPassword3());
		}
		return "result";
	}
	public String password2Valid(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		if(session.getAttribute("loginName")!=null){
			result=registerUserService.password2Valid((String)session.getAttribute("loginName"), registerUserDTO.getPassword2());
		}
		return "result";
	}
	public String changePassword(){
		if(pageUrl==null || pageUrl=="")
			pageUrl="index.jsp";
		HttpSession session = ServletActionContext.getRequest().getSession();
		registerUserDTO.setLoginName((String)session.getAttribute("loginName"));
		resultStr=registerUserService.changePassword(registerUserDTO);
		return "optresult";
	}
	
	public String changePasswordByAdmin(){
		resultStr=registerUserService.changePasswordByAdmin(registerUserDTO);
		return "resultStr";
	}
	
	/**
	 * 分页查询直推用户
	 * @param qdto
	 * @param sord
	 * @param sidx
	 * @return
	 */
	public String findDirectPushUserPager(){
		 int start = ( page - 1 ) * rows;
	     registerUserQueryDTO.setStart( start );
	     registerUserQueryDTO.setLimit( rows );
	     pageDTO = registerUserService.findDirectPushUserPager(registerUserQueryDTO, sord, sidx);
	     if(pageDTO!=null){
	        pageDTO.setPage( page );
	        pageDTO.setRows( rows );
	     }
	     return "recommendPage";
	}
	
	
	public String login(){
		resultStr = registerUserService.login(registerUserDTO.getLoginName(), registerUserDTO.getPassword1());
		if("success".equals(resultStr))
			return "loginSuccess";
		else
			return "loginFailure";
	}
	
	
	public String login2(){
		result = registerUserService.login2(registerUserDTO.getLoginName(), registerUserDTO.getPassword2());
		if(!result){
			pageUrl="user/login2.jsp?error=true&pageUrl="+pageUrl;
		}
		if(!StringUtils.hasText(pageUrl)){
			pageUrl = "mainCopntent.jsp";
		}
		return "dynamicReturn";
	}
	
	public String findUserPager(){
		if(pageUrl==null || pageUrl=="")
			pageUrl="index.jsp";
		 int start = ( page - 1 ) * rows;
	     registerUserQueryDTO.setStart( start );
	     registerUserQueryDTO.setLimit( rows );
	     pageDTO = registerUserService.findRegisterUserPager(registerUserQueryDTO, sord, sidx);
	     if(pageDTO!=null){
	        pageDTO.setPage( page );
	        pageDTO.setRows( rows );
	     }
	     return "dynamicReturn";
	}
	
	public String lastActiveUser(){
		registerUserService.lastActiveUser(startTime);
		return SUCCESS;
	}
	
	public String findUserNameByLoginName(){
		resultStr = registerUserService.findUserNameByLoginName(registerUserDTO.getLoginName());
		return "resultStr";
	}
	
	
	public String applyDeclarationCenter(){
		pageUrl="applyOperatorsCenter.jsp?result=true";
		registerUserService.applyDeclarationCenter(registerUserDTO.getLoginName());
		return "dynamicReturn";
	}
	
	public String openOrCloseDeclarationCenter(){
		registerUserService.openOrCloseDeclarationCenter(registerUserDTO.getLoginName());
		return SUCCESS;
	}
	
	public String jiChaAward(){
		registerUserService.jiChaAward(registerUserDTO.getLoginName());
		return SUCCESS;
	}
	
	//用户激活
	public String userActivate(){
		if(pageUrl==null || pageUrl=="")
			pageUrl="index.jsp";
		try {
			resultStr = registerUserService.userActivate(registerUserDTO.getLoginName(),activeType);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		
		if(resultStr=="success"){
			resultStr = "激活成功!";
		}else{
			resultStr = "激活失败，请检查是否在足够的余额激活!";
		}
		return "optresult";
	};
	//用户充值及扣除
	public String userRecharge(){
//		for(Double i =1D ;  i< 100000 ; i++){
//			resultStr = registerUserService.userRecharge("add", i, "0000");
//		}
		resultStr = registerUserService.userRecharge(dtype, moeny, loginName);
		return "resultStr";
	}
	//充值转入动态或静态
	public String rechargeToDs(){
		if(pageUrl==null || pageUrl=="")
			pageUrl="index.jsp";
		resultStr = registerUserService.rechargeToDs(dtype, moeny, loginName);
		return "optresult";
	}
	
	//我的团队
	public String myTeamPager(){
		int start = ( page - 1 ) * rows;
	     registerUserQueryDTO.setStart( start );
	     registerUserQueryDTO.setLimit( rows );
	     pageDTO = registerUserService.myTeamPager(registerUserQueryDTO, sord, sidx);
	     if(pageDTO!=null){
	        pageDTO.setPage( page );
	        pageDTO.setRows( rows );
	     }
	     return "mytemaPage";
	}
	
	
	public String batchReg(){
		Calendar cl = Calendar.getInstance();
		
		for(int i = 0 ; i<rows ; i++){
			cl.setTime(new Date());
			
			registerUserDTO.setLoginName(new Date().getTime()+""+i);
			registerUserDTO.setPassword1("666666");;
			registerUserDTO.setPassword2("888888");
			registerUserDTO.setUserName(registerUserDTO.getLoginName());
			registerUserDTO.setStatus("Activation");
			registerUserDTO.setAccountType("TEST");
			registerUserService.saveRegisterUser(registerUserDTO);
		}
		return SUCCESS;
	}
	
	public String teamNumber(){
		registerUserService.teamNumber("0000", 100000D, 1, null);
		return SUCCESS;
	}
	
	
	public String teamYeJiStat(){
		teamYeJiStat = registerUserService.teamYeJiStat(registerUserQueryDTO);
		return "teamYeJiStat";
	}
	
	/**
	 * 初始化系统
	 * @return
	 */
	public String initSystemData(){
		registerUserService.initSystemData();
		return SUCCESS;
	}
	
	public String findXPTree(){
		treeViewDTO = registerUserService.findXPTree(registerUserDTO.getLoginName(),lang);
		if("sub".equals(dtype)){
			children = treeViewDTO.getChildren();
			return "children";
		}else{
			return "treeViewDTO";
		}
		
	}
	 public String findUserPassword(){
	    	findResult=registerUserService.findUserPassword(registerUserDTO.getLoginName());
	    	return "findResult";
	   }
	 public String updateUserPassword(){
		 result=registerUserService.updateUserPassword(registerUserDTO);
		 return "result";
	 }
	 
	 public String findGenealogy(){
		 genealogicalTreeDTO = registerUserService.findGenealogy(registerUserDTO.getLoginName());
		 return "genealogicalTreeDTO";
	 }
	 
	 public String userUpgrade(){
		 if(pageUrl==null || pageUrl=="")
			 pageUrl="index.jsp";
		 resultStr = registerUserService.userUpgrade(registerUserDTO);
		 return "optresult";
	 }
	 
	 
	 public String findContactNo(){
		 try {
			 registerUserGridDTOs = registerUserService.findContactNo(loginName,registerLocation);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		 if("json".equals(activeType)){
			 return "registerUserGridDTOs";
		 }else{
			 return "registerUserGridDTOs1";
		 }
		 
		 
	 }
	 
	 public String findSubUserPager(){
		 if(pageUrl==null || pageUrl=="")
				pageUrl="index.jsp";
		 int start = ( page - 1 ) * rows;
	     registerUserQueryDTO.setStart( start );
	     registerUserQueryDTO.setLimit( rows );
	     pageDTO = registerUserService.findSubUserPager(registerUserQueryDTO, sord, sidx);
	     if(pageDTO!=null){
	        pageDTO.setPage( page );
	        pageDTO.setRows( rows );
	     }
		 return SUCCESS;
	 }
	 
	 
	 public String changeUserStatus(){
		 result = registerUserService.changeUserStatus(ids, userStatus);
		 
		 return "result";
	 }
	 
	 public String userOpt(){
		 
		 if(pageUrl==null || pageUrl==""){
			 pageUrl="index.jsp";
		 }
		 if("userActive".equals(optType)){//会员激活
				try {
					resultStr = registerUserService.userOpt(optType, registerUserDTO.getLoginName(), activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,null);
					//resultStr = registerUserService.userActivate(registerUserDTO.getLoginName(),activeType);
				} catch (Exception e) {
					// TODO: handle exception
					e.printStackTrace();
				}
				if(resultStr=="success"){
					resultStr = "激活成功!";
				}else{
					resultStr = "激活失败，请检查是否在足够的余额激活!";
				}
				return "optresult";
			}else if("ZhuanZhang".equals(optType)){//转账
				HttpSession session = ServletActionContext.getRequest().getSession();
				if(session.getAttribute("loginName")!=null && registerUserDTO != null){//获取登录会话
					String loginName = (String)session.getAttribute("loginName");
					registerUserDTO.setLoginName(loginName);
					resultStr=registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,null);
				}else{
					resultStr = "系统超时，请重新登录!";
				}
				return "optresult";
			}else if("ChongZhi".equals(optType)){
				resultStr = registerUserService.userRecharge(dtype, moeny, loginName);
				return "resultStr";
			}else if("TingXiangApply".equals(optType)){//提现申请
				resultStr = registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,null);
		        return "optresult";
			}else if("TingXiangHand".equals(optType)){//提现处理
				resultStr = registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,null);
			}else if("UserUpgrade".equals(optType)){//会员升级
				resultStr = registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,null);
				return "optresult";
			}else if("UserDel".equals(optType)){//会员删除
				resultStr = registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,null);
				return "optresult";
			}else if("ReTouZi".equals(optType)){//重新投资
				resultStr = registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,null);
				return "optresult";
			}else if("MaiChu".equals(optType)){//卖出
				resultStr = registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,sellDTO);
				return "optresult";
			}else if("MaiChuClean".equals(optType)){//卖出取消
				resultStr = registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,sellDTO);
				return "optresult";
			}else if("Buy".equals(optType)){//买入
				resultStr = registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,sellDTO);
				return "optresult";
			}else if("ConfirmPayment".equals(optType)){//卖出确认付款
				resultStr = registerUserService.userOpt(optType, loginName, activeType, transAccount, value, dtype, extractDTO,moeny,upLevel,sellDTO);
				return "optresult";
			}
		 
		 
		 	return "result";
		 	
	 	}
	 
	 public String userAccount1Clean(){
		 registerUserService.userAccount1Clean();
		 return SUCCESS;
	 }
	 
	 
	 public String findUserInfo(){
		 if(pageUrl==null || pageUrl=="")
			 pageUrl="index.jsp";
		 resultStr = registerUserService.findUserInfo(loginName);
		 return "optresult";
	 }
	public String regiserUser(){
		try {
			resultStr = registerUserService.regiserUser(registerUserDTO);
		} catch (Exception e) {
			e.printStackTrace();
			resultStr = "注册失败，请重新注册，谢谢!";
		}
		loginName = registerUserDTO.getLoginName();
		HttpSession session = ServletActionContext.getRequest().getSession();
		session.setAttribute("resultStr", resultStr);
		session.setAttribute("resultStrLoginName", loginName);
		/*if ( resultStr != null && "SUCCESSFUL".equals(resultStr)) {
			//System.out.println("RegisterUserAction.regiserUser()注册成功");
			return "registerResultNew";
		}*/
		return "registerResultNew";
	}
	
	public String saveRegisterInfo(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String loginName = (String) session.getAttribute("loginName");
		registerUserDTO.setLoginName(loginName);
		registerUserService.updateRegisterInfo(registerUserDTO);
		//System.out.println("RegisterUserAction.saveRegisterInfo()" + result); 
		return "loginSuccess";
	}
	
	public String batchAddUser(){
		registerUserService.batchAddUser(rows);
		 return SUCCESS;
	}
}
